<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="__TEMPLATE__less/cart.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/hdjs/hdjs.css"/>
<script src="__TEMPLATE__js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__STATIC__/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function(){
		$('.bd-bottom .decrease').click(function(){
			var sid=$(this).parents('tr').attr('sid');
//			alert(sid);
			var num=$('input[name=qty]').val();
			num--;
			$.ajax({
				type:"post",
				url:"{|U:'OrderList/ajaxUpdate'}",
				data:{
					sid:sid,
					num:num
				},
				dataType : 'json',
				success:function(data){	
					var s=data['sid'];
					var i=data['num'];
					var j=data['price'];
//					$('.ssd').each(function  () {
						if($('.ssd').attr('sid')==s){
							$('.bd-bottom .modify-product-qty').val(i);
							$('.bd-bottom span').html(j);
						}
//					});
				}
			})			
		})
		$('.bd-bottom .increase').click(function(){
			var sid=$(this).parents('tr').attr('sid');
			var num=$('input[name=qty]').val();
			num++;
			$.ajax({
				type:"post",
				url:"{|U:'OrderList/ajaxUpdate'}",
				data:{
					sid:sid,
					num:num
				},
				dataType : 'json',
				success:function(data){	
					var s=data['sid'];
					var i=data['num'];
					var j=data['price'];
					if($('.ssd').attr('sid')==s){
						$('.bd-bottom .modify-product-qty').val(i);
						$('.bd-bottom span').html(j);
					}
				}
			})
		})
	})
</script>
</head>

<body>
<div id="wrapper" >
	<div id="header">
		<a class="logo" href="http://www.vancl.com/" title="凡客诚品" target="_blank">
			<img alt="凡客诚品" src="__TEMPLATE__images/cart/vancl-logo.png">
		</a>
		<div class="help-center">
			<a href="http://help.vancl.com/" target="_blank">帮助中心</a>
		</div>
		<div class="account">
			<p>您好，欢迎光临凡客诚品。
				<if value="isset($_SESSION['username'])">
					<a class="login" href="#">{$hd.session.username}&nbsp;</a>|<a class="login" href="{|U:'Member/out'}">&nbsp;退出</a>
				<else/>
				   	<a class="login" href="{|U:'Member/login'}">登录&nbsp;</a>|<a class="login" href="{|U:'Member/register'}">&nbsp;注册</a>
				</if>
			</p>
		</div>
	</div>
	<div id="location">
		<span class="aa">1.我的购物车</span> 
		<span>2.填写核对信息单</span> 
		<span>3.成功提交订单</span>
	</div>
	<div id="content">
		<div class="cart-top">
			<span></span>
			<h2>我的购物车</h2>
		</div>
		<div class="tip">
			<span>温馨提示：</span>1.选购清单中的商品无法保留库存，请您及时结算。2.商品的价格和库存将以订单提交时为准。3.促销活动满减优惠将均摊至商品小计中。
		</div>
		<div id="cart-product">
			<table cellspacing="0">
				<thead>
					<tr>
						<th class="title-white bd-left">&nbsp;&nbsp;</th>
						<th class="bar-title ">
							<a href="javascript:hd_select_all('.code')">全选</a>
							<a href="javascript:hd_reverse_select('.code')">反选</a
						</th>
						<th class="image">&nbsp;</th>
						<th class="name">商品名称</th>
						<th class="size">尺寸</th>
						<th class="price">单价</th>
						<th class="qty">数量</th>
						<th class="discount">优惠</th>
						<th class="subtotal">小计</th>
						<th class="operate ">操作</th>
						<th class="title-white bd-right">&nbsp;</th>
					</tr>
				</thead>						
				<tbody id="vancl-general-product" name="vancl-general-product" style="background:#F8F8F8;">
					<foreach from='$goods' key='$k' value='$v'>
					<tr class="selected ssd" sid="{$k}">
						<td class="white bd-left bd-bottom">&nbsp;</td>
						<td class="bar bd-bottom" rowspan="1">
							<lable><input class="track ckb" name="p-item"  value="" checked=""  type="checkbox"></lable>
						</td>
						<td class="image bd-bottom" rowspan="1">
							<a target="_blank" href="">
								<img alt="凡客麻衬衫 女装 藏蓝色" src="__TEMPLATE__images/cart/az1.jpg" style="border: 1px solid #C8C8C8;">
							</a>
						</td>
						<td class="name bd-bottom">
							<a target="_blank" href="" title="{$v.name}">{$v.name}</a>
						</td>						
						<td class="size bd-bottom">
							<a target="_blank" title="{$v.options.size}">{$v.options.size}</a>
						</td>						
						<td class="price bd-bottom">￥{$v.price}</td>
						
						<td class="qty bd-bottom">
								<a class="decrease" href="javascript:;">-</a>
								<input name="qty" class="modify-product-qty" value="{$v.num}" maxlength="3" type="text">
								<a class="increase" href="javascript:;">+</a>
						</td>
						
						<td class="bd-bottom">-</td>
						<td class="subtotal bd-bottom">￥<span>{$v.total}</span></td>
						<td class="operate bd-bottom">
							<a class="del track" name="" href="{|U:'OrderList/del',array('sid'=>$k)}">删除</a>
						</td>
						<td class="white bd-right bd-bottom">&nbsp;</td>
					</tr>
					</foreach>
				</tbody>
			</table>
			<div style="margin-top: 25px;" id="bar-summary">
				<div class="bar">
					<input checked="checked" id="all-ckb-bt" name="all-products" value="all-products" class="track all-products-ckb ckb"  type="checkbox">
					<label for="all-ckb-bt">全选</label>
					<a href="{|U:'OrderList/del',array('sid'=>$k)}" class="batch-del-cart track">全部删除</a>
					<span>数量总计：<i>{$totalNums}</i>件</span>
				</div>
				<div class="summary">
					产品金额总计(不含运费)：<span class="amount">￥<em>{$totalPrice}</em></span>
				</div>
				<div class="btn-panel">
					<a href="{|U:'Index/index'}" class="go-buy track" name="">&lt;&lt;继续购物</a> 
					<a class="checkout track" href="{|U:'Order/index'}">去结算&gt;&gt;</a>
				</div>
			</div>
		</div>
	</div>

<center>
<div id="bottom" align="center">
	<div id="bottoms">
		<p class="bZp3">Copyright 2007 - 2014 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11010102000579号 出版物经营许可证新出发京批字第直110138号</p>
		<div id="footerArea">
			<div class="subFooter">
				<a rel="nofollow" href="https://search.szfw.org/cert/l/CX20111229001302001330" class="redLogo" target="_blank"></a>
				<a rel="nofollow" href="http://www.315online.com.cn/member/315090053.html" class="wsjyBzzx" target="_blank"></a>
				<a rel="nofollow" href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202010081900017" class="vanclMsg" target="_blank"></a>
				<a rel="nofollow" href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202010081900017" class="vanclqingNian" target="_blank"></a>
			</div>
		</div>
	</div>
</div>
</center>
</div>
</body>
</html>
